-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable typing in a few more files #14937
Conversation
Review period will end on 2023-03-10 at 17:31:46 UTC. |
Library/Homebrew/test.rb
Outdated
run_test = proc do | ||
raise "test returned false" if formula.run_test(keep_tmp: args.keep_tmp?) == false | ||
end | ||
# TODO: the current version of sorbet does not support `proc` here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the error here? Is there an issue we can link to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No linked issue that I can find. Here's a summary of the distinction: https://sorbet.run/#%23%20typed%3A%20true%0A%0Arequire%20'timeout'%0A%0Ap1%20%3D%20Proc.new%20%7B%20raise%20%22p1%20large%20rand%22%20if%20rand%20%3E%200.5%7D%0AT.reveal_type%28p1%29%0Ap2%20%3D%20proc%20%7B%20raise%20%22p2%20large%20rand%22%20if%20rand%20%3E%200.5%7D%0AT.reveal_type%28p2%29%0A%0ATimeout.timeout%281%2C%20%26p1%29%0ATimeout.timeout%281%2C%20%26p2%29
It could probably be avoided with a bit of redirection, but i'd prefer to disable the cop:
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so it's because the proc
doesn't have an argument?
2304b92
to
5a352a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maybe squash the last few commits.
Library/Homebrew/test.rb
Outdated
|
||
# tests can also return false to indicate failure | ||
run_test = proc do | ||
run_test = proc do |_ = nil| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, very nice @reitermarkus
Thanks again @dduugg (and @reitermarkus!). |
Review period skipped due to |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This is a mix of files with typing enabled (we're down to <100 files outside of the
sorbet
/test
/vendor
dirs that aretyped: false
, so i'm chipping away at these when i have a few cycles to spare)